package org.hackystat.ui.chart.jfc.fileresource;

import java.io.File;

import org.hackystat.ui.chart.jfc.server.Server;

/**
 * Serves charts for the JFCS server.
 *
 * @author Pavel Senin.
 *
 */
public class ChartFileManager {

  private Server server;

  /**
   * Instantiates the FileManager.
   *
   * @param server the server handler.
   */
  public ChartFileManager(Server server) {
    this.server = server;
  }

  /**
   * Reports the file which is asked.
   *
   * @param chartName the chart name asked.
   * @return file handler.
   */
  public File getChartImage(String chartName) {
    File chartFile = new File(this.server.getStoragePath() + "/" + chartName);
    return chartFile;
  }

}
